package com.fanjun.learning.multithread.ATM;

import java.util.Date;

/**
 * Created by memedai on 2016/10/13.
 */
public class Main {
//    private volatile double acount;
    public static void main(String[] args) throws InterruptedException {
        ATM atm = new ATM(100);
        DepositThread d1 = new DepositThread("d1",atm);
        DepositThread d2 = new DepositThread("d2",atm);
        WithdrawThread w1 = new WithdrawThread("w1", atm);
        WithdrawThread w2 = new WithdrawThread("w2", atm);

        d1.start();
        d2.start();
        w1.start();
        w2.start();

        Thread.sleep(5000);

        System.out.println("===========" + atm.getAccount() + "============");
    }
}
